package com.lb.shopguide.ui.fragment;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.lb.shopguide.R;
import com.lb.shopguide.base.BaseCommonFragment;
import com.lb.shopguide.constants.AppConstant;
import com.lb.shopguide.entity.UpdateInfoBean;
import com.lb.shopguide.ui.activity.GuideActivity;
import com.lb.shopguide.ui.fragment.boss.FragmentBossHome;
import com.lb.shopguide.ui.fragment.boss.FragmentBossLogin;
import com.lb.shopguide.ui.fragment.guide.FragmentEnterPhone;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by kang on 2017/12/23.
 * 选择角色，老板，导购
 */

public class FragmentChooseRole extends BaseCommonFragment {
    @BindView(R.id.layout_boss)
    RelativeLayout layoutBoss;
    @BindView(R.id.layout_guide)
    RelativeLayout layoutGuide;


    private UpdateInfoBean updateInfoBean;

    public static FragmentChooseRole newInstance(UpdateInfoBean updateInfoBean) {
        FragmentChooseRole fragment = new FragmentChooseRole();
        Bundle bundle = new Bundle();
        if (updateInfoBean != null) {
            bundle.putSerializable(AppConstant.UPDATE_BEAN, updateInfoBean);
        }
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_choose_role;
    }

    @Override
    public void initData() {
        Bundle bundle = getArguments();
        if (bundle.containsKey(AppConstant.UPDATE_BEAN)) {
            updateInfoBean = (UpdateInfoBean) bundle.getSerializable(AppConstant.UPDATE_BEAN);
        } else {
            updateInfoBean = null;
        }
    }

    @Override
    public void initView() {
    }

    @Override
    public void finishRefresh() {

    }

    @Override
    public void sessionOutOfDate() {

    }

    @Override
    public void requestError(String error) {

    }


    @Override
    public String getPageTag() {
        return FragmentChooseRole.class.getName();
    }

    @OnClick(R.id.layout_boss)
    void bossClick(){
        start(FragmentBossLogin.newInstance(updateInfoBean));
    }

    @OnClick(R.id.layout_guide)
    void guideClick(){
        start(FragmentEnterPhone.newInstance(updateInfoBean));
    }

}
